<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="main.css">
    <title>水上水下活动通航安全审核申请书</title>
    
	<!--jquery -->
	<script type="text/javascript" src="../js/jquery/jquery-2.0.3.min.js" ></script>
	
	<script type="text/javascript" src="../js/share.js"></script>
<!-- 	<script type="text/javascript" src="11.js" ></script> -->
	
	<script type="text/javascript">

	$(function(){
		applyno = getUrlParam("applyno");
		bindApply(applyno);
	});


	function bindApply(applyno){
		$.ajax({ 
			url: basePath() + 'business/getapplyinfo.do',
			data: {"applyno": applyno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonApply = data.datas;
		    		
		    		bindApplyForm(jsonApply);
		    		
		    		//绑定业务资料
		    		bindBusinessForm(jsonApply['applyid'], jsonApply['itemno']);
//		    		
//		    		//绑定附件材料
		    		bindMaterialListForm(jsonApply['applyid']);	 

		    	}
	      	}
		});
	}

	function bindApplyForm(jsonApply){
		for(var d in jsonApply){//遍历json对象的每个key/value对,p为key
			if(d == 'applytime'){
				$('#' + d).html(formatDate(jsonApply[d], 'yyyy-mm-dd hh:mi'));
			} else{
				if(d == 'orgname') {
					$('#orgname1').html(jsonApply[d] == '' ? '/' : jsonApply[d]);
				}
				if(d == 'proposer') {
					$('#proposer1').html(jsonApply[d] == '' ? '/' : jsonApply[d]);
				}
				$('#' + d).html(jsonApply[d] == '' ? '/' : jsonApply[d]);
			}
		}
	}

	function bindBusinessForm(applyid, itemno){

		$.ajax({ 
			url: basePath() + 'business/getbusinessinfo.do',
			data: {"applyid": applyid, "itemno": itemno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonBusiness = data.datas;

		    		for(var d in jsonBusiness){//遍历json对象的每个key/value对,p为key
		    			if(d == 'workbegintime' || d == 'workendtime'){
		    				$('#' + d).html(formatDate(jsonBusiness[d], 'yyyy-mm-dd'));
		    			}
		    			else{
		    				$('#' + d).html(jsonBusiness[d] == '' ? '/' : jsonBusiness[d]);
		    			}
		    		}
		    	}
	      	}
		});
	}

	function bindMaterialListForm(applyid){

		$.ajax({ 
			url: basePath() + 'business/getmaterialinfo.do',
			data: {"applyid": applyid},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonMaterial = data.datas;

					var k = 1;
					for(var i = 0; i < jsonMaterial.length; i++){
						var materialname = jsonMaterial[i]['materialname'];
						
						var fileid=jsonMaterial[i]['fileid']
						if('' != fileid){
							var materialnameHmtl = k + '、' + materialname + '<br />';
							$('#material').append(materialnameHmtl);
							k++;
						}
					}
		    	}
	      	}
		});
	}

	function bindDevice(applyid){
		$.ajax({ 
			url: basePath() + 'business/getshipinfo.do?applyid='+applyid,
			dataType: "json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonDevice = data.datas;
					for(var i = 0; i < jsonDevice.length; i++){
						var shipname = jsonDevice[i]['shipname'];
						var technicalparameter = generator(jsonDevice[i]);
						$("#materialtr").before('<tr><td class="td-4"><span>'+shipname+'</span></td><td style="width: 600px;text-align:center;font-size: 14px;"><span>'+technicalparameter+'</span></td></tr>');
					}
		    	}
	      	}
		});
	}
	function generator(jsonDevice){
		var builddate = formatDate(jsonDevice["builddate"], 'yyyy-mm-dd');
		var technicalparameter = "总吨位:"+jsonDevice['grosstonnage']+",净吨位:"+jsonDevice['nettonnage']+",总功率:"+jsonDevice['enginepower']+",客位:"+jsonDevice['ratedseat']+",总长:"+jsonDevice['overalllength']+",型宽:"+jsonDevice['mouldedbreadth']+",型深:"+jsonDevice['mouldeddepth']+",建造日期:"+builddate+",所有人:"+jsonDevice['owner']+",经营人:"+jsonDevice['operator'];
		return technicalparameter;
	}
	</script>
	
	<style>
		.td-4{
			width: 200px;
			text-align: left;
			font-size: 16px;
			font-weight: 800;
			}
		.td-5{
			width: 510px;
			font-size: 16px;
		}
		
	</style>
</head>
<body>
<h2 align="center" style="font-size: 25px;font-family:'Adobe 黑体 Std R';font-weight:bold;margin-top: 50px">外国籍船舶进入或临时进入非对外开放水域申请书</h2>
<table border="0"  align="center" cellspacing="0" cellpadding="0">
    <tr style="font-size: 20px;">
        <td style="border-color: transparent; width:710px;">
                <p >编号：</p>
                <p > <span id="orgname">（**海事局）</span>：</p>
                <p style="word-break: break-word;line-height: 40px;text-indent: 2em;">我（单位）现向<span id="orgname1">（**海事局）</span>申请外国籍船舶进入或临时进入非对外开放水域行政许可，并提交如下申请材料：</p>
                <span style="word-break: break-word;">
					<ol>
						<li style="line-height: 40px;">书面申请，说明进入非对外开放水域（港口）范围及必要性（位置、开放内容、开放范围、开放时间、经济效益等相关资料；说明口岸列入国家发展规划和计划情况及船舶拟进入非对外开放水域（港口）的必要性；船舶状况满足拟进入水域的水上交通安全、防污染和保安要求的证明；已制定保障水上交通安全、防污染和保安的措施以及应急预案安全措施的证明等）。</li>
                        <li style="line-height: 40px;">当地口岸查验机构、军事主管部门、地方人民政府的同意意见。</li>
                        <li style="line-height: 40px;">满足水上交通安全和防污染、应急、保安要求的证明文件。</li>
                        <li style="line-height: 40px;">港口、水域通航状况专家评估意见（涉及通航安全时）。</li>
                        <li style="line-height: 40px;">委托证明及委托人和被委托人身份证明及其复印件（委托时）。</li>
                    </ol>
                </span>
                <p style="margin-left: 40px;">申请人承诺：以上提交材料真实合法有效。</p>
                <p style="margin-left: 40px;">请依法审查并予以批准。</p>
                <p align="right" style="margin-top: 50px;margin-right: 100px;"> 申请人签字（盖章）<span id="proposer"></span></p>
                <p align="right" style="margin-top: 50px;margin-right: 100px;" id="applytime"> &nbsp;&nbsp;年&nbsp;&nbsp;月&nbsp;&nbsp;日</p>
				
        </td>
    </tr>
</table>
<div style="height: 300px;"></div>
<div style="height: 1280px;">
<table border="0" align="center" cellspacing="0" cellpadding="0">
    <tr>
        <td class="td-4">行政许可申请人名称/姓名：</td>
        <td class="td-5" style="text-align: left;">
         	&nbsp;
        	<span id="proposer1"></span>
       	</td>
    </tr>
	<tr>
        <td class="td-4">职务：</td>
        <td class="td-5" style="text-align: left;">
			&nbsp;
			<span id="job"></span>
       	</td>
    </tr>
	<tr>
        <td class="td-4">委托代理人姓名：</td>
        <td class="td-5" style="text-align: left;">
         	&nbsp;
        	<span id="agentname"></span>
        </td>
    </tr>
    <tr>
        <td class="td-4">联系方式：</td>
        <td class="td-5" id="mobile">
        </td>
    </tr>
    <tr>
        <td class="td-4">法定代表人/身份证号码：</td>
        <td class="td-5" style="text-align: left;">
        	&nbsp;
        	<span id="info"></span>
        </td>
    </tr>
    <tr>
        <td class="td-4">工作单位：</td>
        <td class="td-5" style="text-align: left;">
         	&nbsp;
        	<span id="workunit"></span>
       	</td>
    </tr>
    <tr>
        <td class="td-4">电话：</td>
        <td class="td-5" style="text-align: left;">
         	&nbsp;
        	<span id="mobilephone"></span>
       	</td>
    </tr>
    <tr>
        <td class="td-4">住址/地址：</td>
        <td class="td-5" style="text-align: left;">
         	&nbsp;
        	<span id="address"></span>
       	</td>
    </tr>
    <tr>
        <td class="td-4">邮编：</td>
        <td class="td-5" style="text-align: left;">
         	&nbsp;
        	<span id="postcode"></span>
       	</td>
    </tr>
    <tr>
        <td class="td-4">电子邮箱：</td>
        <td class="td-5" style="text-align: left;">
         	&nbsp;
        	<span id="email"></span>
       	</td>
    </tr>
 </table>
 </div>
</body>
</html>